import React from 'react-native'
import { connect } from 'react-redux'
import Login from '../components/Login'
import { odooActionCreators } from '../redux'

const mapStateToProps = (state) => ({
  logining: state.odoo.logining,
  isLogined: state.odoo.isLogined,
  loginError: state.odoo.loginError
})

const mapDispatchToProps = (dispatch) => ({
  loginPress: (username, password) => {
    dispatch(odooActionCreators.login(username, password))
  }
})

export default connect(mapStateToProps, mapDispatchToProps)(Login)
